import { Component,EventEmitter } from "@angular/core";

@Component({
    selector:'student',
    inputs:['name'],
    outputs:['studentSelected'],
    template:`
    <p (click)="onCliced()">{{name}}</p>`
})
export class Student{ 
    name!: string;
    
   studentSelected: EventEmitter<string>;
 
    
    constructor(){
        this.studentSelected=new EventEmitter();
    }

    onCliced(){
        this.studentSelected.emit(this.name);
    }
}